package com.example.application;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;

import com.example.Utils.DBUtil;
import com.example.Utils.MyHelper;

public class MyApplication extends Application {
	private SQLiteDatabase db;
	private MyHelper helper;
	private static MyApplication application;
private SharedPreferences mpreferences;
	@Override
	public void onCreate() {
		super.onCreate();
		
		application = this;
		helper=new MyHelper(this,DBUtil.TABLE, null, DBUtil.VERSION);
		db= helper.getWritableDatabase();
		mpreferences=getSharedPreferences("boolean", Context.MODE_PRIVATE);
		
	}
	
	public SharedPreferences getMpreferences() {
		return mpreferences;
	}

	public static MyApplication getInstance(){
		return application;
	}

	public SQLiteDatabase getDb() {
		
		return db;
	}


}
